{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import gym\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[2016-11-16 23:36:18,386] Making new env: Breakout-v0\n"
     ]
    }
   ],
   "source": [
    "env = gym.envs.make(\"Breakout-v0\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Action space size: 6\n",
      "['NOOP', 'FIRE', 'RIGHT', 'LEFT', 'RIGHTFIRE', 'LEFTFIRE']\n",
      "Observation space shape: (210, 160, 3)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM8AAAEACAYAAAAUSCKKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEGNJREFUeJzt3X+Q1PV9x/Hn+w4OQRQPBo4ACug10QxtL4xzaqgTSiie\ndhpjZzSO06k/pjN2mkw7mWkDJH84/UvpTJrWSa1jYq1p1ahNE+k0OS/4g5o/QB1EMALeqigncpBB\nIILA3e27f3y/h3vn7t3u+7vL7p2vx8wOu5/v9/v+vm/Z136/+73vd8/cHRGpXFO9GxCZqBQekSCF\nRyRI4REJUnhEghQekaCahcfMusxst5m9YWZra7UekXqxWvyex8yagDeALwP7gZeAm919d9VXJlIn\ntdrydAK97v6Ouw8APwaur9G6ROqiVuFZCOwreNyXjolMGrUKjxUZ03lAMqlMqVHdPuCigseLSD77\nnGFmCpNMCO5ebGNQsy3PS0C7mS02sxbgZmBjjdYlUhc12fK4+5CZfQPoIQnog+6+qxbrEqmXmhyq\nLmvF2m2TCaLUblutPvNMWB0d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Xgn8ouDxOmBtFeqW\nujx8d4V1FgG/BFYWhOdQwX/6lUB3hTXPA94sMh7uNQ3PO0Br+qLbCPwRyXVVFfdK8ma2Y4zeKrrM\nvljNUdO+SnJ92CdeA8AvgCvKrQk8CfzuqPCU3Wf0Vo/dttGXafeR8TLtcS4Pn1thue8Bf0d69auZ\nzQE+cPfhL/fqI3nhVuJi4Ddm9lC6O/iAmc3I0qu77we+S3I5yHvAUWAbyfVTWXodNs9re5n9HcDP\ns9Y0sz8B9rn7zlGTav51APUIT1Uv067g8vByav0x0O/JV2UN92l8sudK1zEFWA78i7svJ7nOaV3G\nXi8Arid5J14AnEuyqzJatX8Xkfn/z8y+Awy4+2NZaprZdOA7wF3FJkdqVqIe4ekDLip4HL5Mu8LL\nw8uxAviKmb0FPAasAv4JmGVmw89VpN8+knfHl9PHPyEJU5ZeVwNvufthdx8Cfgp8EbggY6/DanKZ\nvZndClwH3FIwHK15CclnpFfN7O10uW1mNi9rn+WoR3heAtrNbLGZtQA3k+yvR4x3efitfHx5+Ljc\n/dvufpG7X5z29ay7/xnwHHBjpGZatx/YZ2afTYe+DPw6S68ku2tXmtk5ZmYFNaO9jt7CVuMy+xE1\nzawL+BbwFXcv/ONMG4Gb06OFS4F2kiuVx6zp7q+5+3x3v9jdl5IE5gvufrDCPmOq+QGqgg+7XSRH\nx3qBdcEaK0i+wXQ7yZGabWnd2cCmtP4vgQuC9b/ExwcMlgJbgTdIjmZNDdT7fZI3ju3Af5McbcvU\nK8nuyi5gB/AwydHLinsFHiV5Vz5FEsrbSQ5EFO0N+D7JEbFXgeUV1OwlOcixLb3dVzD/+rTmLmBN\nuTVHTX+L9IBBuX1muen0HJEgnWEgEqTwiAQpPCJBCo9IkMIjEqTwiAQpPCJBCo9I0P8DEdhXRvCY\nGIIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x109103630>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw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trNbLGZtQA3k+yvR4x3efitfHx5+Ljc\n/dvufpG7X5z29ay7/xnwHHBjpGZatx/YZ2afTYe+DPw6S68ku2tXmtk5ZmYFNaO9jt7CVuMy+xE1\nzawL+BbwFXcv/ONMG4Gb06OFS4F2kiuVx6zp7q+5+3x3v9jdl5IE5gvufrDCPmOq+QGqgg+7XSRH\nx3qBdcEaK0i+wXQ7yZGabWnd2cCmtP4vgQuC9b/ExwcMlgJbgTdIjmZNDdT7fZI3ju3Af5McbcvU\nK8nuyi5gB/AwydHLinsFHiV5Vz5FEsrbSQ5EFO0N+D7JEbFXgeUV1OwlOcixLb3dVzD/+rTmLmBN\nuTVHTX+L9IBBuX1muen0HJEgnWEgEqTwiAQpPCJBCo9IkMIjEqTwiAQpPCJBCo9I0P8DEdhXRvCY\nGIIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1092c2470>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(\"Action space size: {}\".format(env.action_space.n))\n",
    "print(env.get_action_meanings()) # env.unwrapped.get_action_meanings() for gym 0.8.0 or later\n",
    "\n",
    "observation = env.reset()\n",
    "print(\"Observation space shape: {}\".format(observation.shape))\n",
    "\n",
    "plt.figure()\n",
    "plt.imshow(env.render(mode='rgb_array'))\n",
    "\n",
    "[env.step(2) for x in range(1)]\n",
    "plt.figure()\n",
    "plt.imshow(env.render(mode='rgb_array'))\n",
    "\n",
    "env.render(close=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x108de7748>"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQQAAAD/CAYAAAAXKqhkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAENZ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OA\nGNf8TgTurqpHqmor8G3g1cABY5rfM+aazybgJUPb9dZ3kjOBU4C3DzWPo7+jGFyPuDHJPd0+1yY5\neEz97ZRJBMKPgRVJXppkKXAGg3PSvn0FuK2qvjDUtgo4q1s+E7h65jfNR1VdWFWHVdWRDOZzfVW9\nA/g+cPoY+psGNiZ5Wdf0RuBWxjQ/BqcKJyTZO0mG+ut7fjOPqobnc9bQ/lcB7wRIcgKDU5fpUftL\nshL4KHBqVT05YxxndHdWjgBWAD8apb+quqWqDqmqI6vqCAYh8PtV9RD9ze+5W4gLFbNcXFnJ4Mr/\nXcD5Y9j/a4CtDO5g3MDgfHclcBBwXdf394ADxtD369h+UfEI4IfAnQyuyO/VYz+/xyBc1wH/xOAu\nw9jmx+DQdj1wE3ApgztEvc0P+AaDd8EnGQTQ2QwuYs46H+CvGVztvxE4rqf+7mJw8XRt9/Wloe0v\n6PpbD5zUR38z1t9Nd1Gxj/nN98t/yyCp8UlFSY2BIKkxECQ1BoKkxkCQ1BgIkhoDQVLzf3eqTb2L\nl4WOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10c069f28>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Check out what a cropped image looks like\n",
    "plt.imshow(observation[34:-16,:,:])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
